package com.spittr.web;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RepositoryController {
	
	private static final Logger logger = Logger.getLogger(RepositoryController.class);
	
	@Autowired
	private RepositoryService repositoryService;
	
	@Autowired
	private RedisTemplate<String,String> redisTemplate;

	@RequestMapping("/repository.do")
	@ResponseBody
	public String repository() {
		System.out.println("123");
		logger.info("12333");
		redisTemplate.opsForValue().set("name", "abc");
		String name = redisTemplate.opsForValue().get("name");
		logger.info(name);
		try {
//			repositoryService.repository();
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
		}
		
//		throw new CodeMistakeException();
		return "repository";
	}
}
